<!DOCTYPE html>
<html>
<head>
    

    

    
<!-- Baidu Tongji -->
<script>var _hmt = _hmt || []</script>
<script async src="//hm.baidu.com/hm.js?48711b05b1c1178a5b74ec9dcd75c600"></script>
<!-- End Baidu Tongji -->




    <meta charset="utf-8">
    <meta name="baidu-site-verification" content="d0GGaTdNRH" />
    
    
    
    
    <title>react 初始化项目配置 @/、less、vw | jscheng</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <!--<meta name="keywords" content="react">-->
    <meta name="keywords" content="react 初始化项目配置 @/、less、vw | jscheng">

    <meta name="description" content="web前端,jscheng,blog,jscheng的博客，JSCheng">
<meta property="og:type" content="blog">
<meta property="og:title" content="react 初始化项目配置 @&#x2F;、less、vw">
<meta property="og:url" content="https://www.jscheng.top/2020/05/09/react-cli/index.html">
<meta property="og:site_name" content="jscheng">
<meta property="og:description" content="web前端,jscheng,blog,jscheng的博客，JSCheng">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-05-09T06:01:13.000Z">
<meta property="article:modified_time" content="2021-07-09T05:22:26.095Z">
<meta property="article:author" content="jscheng">
<meta property="article:tag" content="react">
<meta name="twitter:card" content="summary">

    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

<meta name="generator" content="Hexo 4.2.1"></head>

<body>
    <style>
        .container{
            /* width: 1200px; */
        }
        *{
            box-sizing: border-box;
        }
    </style>
    <img src="https://jscheng-img.oss-cn-shanghai.aliyuncs.com/logo.png" alt="logo" hidden>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.png">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">jscheng</h5>
          <a href="mailto:wangcheng55555@163.com" title="wangcheng55555@163.com" class="mail">wangcheng55555@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                目录
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                类别
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/about"  >
                <i class="icon icon-lg icon-link"></i>
                about
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">react 初始化项目配置 @/、less、vw</div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">react 初始化项目配置 @/、less、vw</h1>
        <h5 class="subtitle">
            
                <time datetime="2020-05-09T06:01:13.000Z" itemprop="datePublished" class="page-time">
  2020-05-09
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#"><span class="post-toc-number">1.</span> <span class="post-toc-text">@&#x2F;</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#webpack-config-js"><span class="post-toc-number">1.0.0.0.1.</span> <span class="post-toc-text">webpack.config.js</span></a></li></ol></li></ol></li></ol></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#less"><span class="post-toc-number"></span> <span class="post-toc-text">less</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#装依赖"><span class="post-toc-number">0.0.0.0.1.</span> <span class="post-toc-text">装依赖</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#webpack-config-js-1"><span class="post-toc-number">0.0.0.0.2.</span> <span class="post-toc-text">webpack.config.js</span></a></li></ol></li></ol></li></ol></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#Autoprefixer-px2vw"><span class="post-toc-number"></span> <span class="post-toc-text">Autoprefixer px2vw</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#装依赖-1"><span class="post-toc-number">0.0.0.0.1.</span> <span class="post-toc-text">装依赖</span></a></li><li class="post-toc-item post-toc-level-6"><a class="post-toc-link" href="#webpack-config-js-2"><span class="post-toc-number">0.0.0.0.2.</span> <span class="post-toc-text">webpack.config.js</span></a></li></ol></li></ol></li></ol></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#react-router-dom"><span class="post-toc-number"></span> <span class="post-toc-text">react-router-dom</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#redux"><span class="post-toc-number"></span> <span class="post-toc-text">redux</span></a>
        </nav>
    </aside>


<article id="post-react-cli"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">react 初始化项目配置 @/、less、vw</h1>
        <div class="post-meta">
            <time class="post-time" title="2020-05-09 14:01:13" datetime="2020-05-09T06:01:13.000Z"  itemprop="datePublished">2020-05-09</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h2 id=""><a href="#" class="headerlink" title="@/"></a>@/</h2><h6 id="webpack-config-js"><a href="#webpack-config-js" class="headerlink" title="webpack.config.js"></a>webpack.config.js</h6><p>resolve ===&gt; alias ===&gt; 添加 ‘@’:paths.appSrc</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">alias: &#123;</span><br><span class="line">       &#x2F;&#x2F; Support React Native Web</span><br><span class="line">       &#x2F;&#x2F; https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2016&#x2F;08&#x2F;a-glimpse-into-the-future-with-react-native-for-web&#x2F;</span><br><span class="line">       &#39;react-native&#39;: &#39;react-native-web&#39;,</span><br><span class="line">       &#x2F;&#x2F; Allows for better profiling with ReactDevTools</span><br><span class="line">       ...(isEnvProductionProfile &amp;&amp; &#123;</span><br><span class="line">         &#39;react-dom$&#39;: &#39;react-dom&#x2F;profiling&#39;,</span><br><span class="line">         &#39;scheduler&#x2F;tracing&#39;: &#39;scheduler&#x2F;tracing-profiling&#39;,</span><br><span class="line">       &#125;),</span><br><span class="line">       ...(modules.webpackAliases || &#123;&#125;),</span><br><span class="line">       &#x2F;&#x2F;todo &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;start&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;</span><br><span class="line">       &#39;@&#39;:paths.appSrc</span><br><span class="line">       &#x2F;&#x2F;todo &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;end&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;</span><br><span class="line">     &#125;,</span><br></pre></td></tr></table></figure>
<h1 id="less"><a href="#less" class="headerlink" title="less"></a>less</h1><h6 id="装依赖"><a href="#装依赖" class="headerlink" title="装依赖"></a>装依赖</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yarn add less less-loader -S</span><br></pre></td></tr></table></figure>
<p>或</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm i less less-loader -S</span><br></pre></td></tr></table></figure>
<h6 id="webpack-config-js-1"><a href="#webpack-config-js-1" class="headerlink" title="webpack.config.js"></a>webpack.config.js</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F; 添加 style files regexes</span><br><span class="line">const lessRegex &#x3D; &#x2F;\.(less)$&#x2F;;</span><br><span class="line">const lessModuleRegex &#x3D; &#x2F;\.module\.(less)$&#x2F;;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;css rules  &#x3D;&#x3D;&#x3D;&#x3D;&gt; sass 后边加上 或更改 sass</span><br><span class="line"> &#123;</span><br><span class="line">      test: lessRegex,</span><br><span class="line">      exclude: lessModuleRegex,</span><br><span class="line">      use: getStyleLoaders(</span><br><span class="line">        &#123;</span><br><span class="line">          importLoaders: 2,</span><br><span class="line">          sourceMap: isEnvProduction &amp;&amp; shouldUseSourceMap,</span><br><span class="line">        &#125;,</span><br><span class="line">        &#39;less-loader&#39;</span><br><span class="line">      ),</span><br><span class="line">      &#x2F;&#x2F; Don&#39;t consider CSS imports dead code even if the</span><br><span class="line">      &#x2F;&#x2F; containing package claims to have no side effects.</span><br><span class="line">      &#x2F;&#x2F; Remove this when webpack adds a warning or an error for this.</span><br><span class="line">      &#x2F;&#x2F; See https:&#x2F;&#x2F;github.com&#x2F;webpack&#x2F;webpack&#x2F;issues&#x2F;6571</span><br><span class="line">      sideEffects: true,</span><br><span class="line">  &#125;,</span><br></pre></td></tr></table></figure>
<h1 id="Autoprefixer-px2vw"><a href="#Autoprefixer-px2vw" class="headerlink" title="Autoprefixer px2vw"></a>Autoprefixer px2vw</h1><h6 id="装依赖-1"><a href="#装依赖-1" class="headerlink" title="装依赖"></a>装依赖</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yarn add  postcss-aspect-ratio-mini postcss-px-to-viewport postcss-write-svg postcss-cssnext postcss-viewport-units cssnano autoprefixer -D</span><br></pre></td></tr></table></figure>
<p>或者</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm i --save postcss-aspect-ratio-mini postcss-px-to-viewport postcss-write-svg postcss-cssnext postcss-viewport-units cssnano autoprefixer</span><br></pre></td></tr></table></figure>
<h6 id="webpack-config-js-2"><a href="#webpack-config-js-2" class="headerlink" title="webpack.config.js"></a>webpack.config.js</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F;引入新添加</span><br><span class="line">const Autoprefixer &#x3D; require(&#39;autoprefixer&#39;);</span><br><span class="line">const postcssAspectRatioMini &#x3D; require(&#39;postcss-aspect-ratio-mini&#39;);</span><br><span class="line">const postcssPxToViewport &#x3D; require(&#39;postcss-px-to-viewport&#39;);</span><br><span class="line">const postcssWriteSvg &#x3D; require(&#39;postcss-write-svg&#39;);</span><br><span class="line">const postcssCssnext &#x3D; require(&#39;postcss-cssnext&#39;);</span><br><span class="line">const postcssViewportUnits &#x3D; require(&#39;postcss-viewport-units&#39;);</span><br><span class="line">const cssnano &#x3D; require(&#39;cssnano&#39;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;getStyleLoaders &#x3D;&#x3D;&#x3D;&gt; plugins</span><br><span class="line">plugins: () &#x3D;&gt; [</span><br><span class="line">        require(&#39;postcss-flexbugs-fixes&#39;),</span><br><span class="line">        &#x2F;&#x2F; add&#x3D;&#x3D;&#x3D;start&#x3D;&#x3D;&#x3D;</span><br><span class="line">        Autoprefixer(&#123;</span><br><span class="line">            overrideBrowserslist: [</span><br><span class="line">                &quot;Android 4.1&quot;,</span><br><span class="line">                &quot;iOS 7.1&quot;,</span><br><span class="line">                &quot;Chrome &gt; 31&quot;,</span><br><span class="line">                &quot;ff &gt; 31&quot;,</span><br><span class="line">                &quot;ie &gt;&#x3D; 8&quot;</span><br><span class="line">            ]</span><br><span class="line">        &#125;),</span><br><span class="line">        &#x2F;&#x2F;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;end&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;</span><br><span class="line">        require(&#39;postcss-preset-env&#39;)(&#123;</span><br><span class="line">            autoprefixer: &#123;</span><br><span class="line">                flexbox: &#39;no-2009&#39;,</span><br><span class="line">            &#125;,</span><br><span class="line">            stage: 3,</span><br><span class="line">        &#125;),</span><br><span class="line">        &#x2F;&#x2F; add &#x3D;&#x3D;&#x3D;&#x3D;start &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;</span><br><span class="line">        postcssAspectRatioMini(&#123;&#125;),</span><br><span class="line">        postcssPxToViewport(&#123;</span><br><span class="line">            viewportWidth: 375, &#x2F;&#x2F; (Number) The width of the viewport.</span><br><span class="line">            viewportHeight: 667, &#x2F;&#x2F; (Number) The height of the viewport.</span><br><span class="line">            unitPrecision: 3, &#x2F;&#x2F; (Number) The decimal numbers to allow the REM units to grow to.</span><br><span class="line">            viewportUnit: &#39;vw&#39;, &#x2F;&#x2F; (String) Expected units.</span><br><span class="line">            selectorBlackList: [&#39;.ignore&#39;, &#39;.hairlines&#39;, &#39;.list-row-bottom-line&#39;, &#39;.list-row-top-line&#39;], &#x2F;&#x2F; (Array) The selectors to ignore and leave as px.</span><br><span class="line">            minPixelValue: 1, &#x2F;&#x2F; (Number) Set the minimum pixel value to replace.</span><br><span class="line">            mediaQuery: false &#x2F;&#x2F; (Boolean) Allow px to be converted in media queries.</span><br><span class="line">        &#125;),</span><br><span class="line">        postcssWriteSvg(&#123;</span><br><span class="line">            utf8: false</span><br><span class="line">        &#125;),</span><br><span class="line">        &#x2F;&#x2F; postcssPresetEnv(&#123;&#125;),</span><br><span class="line">        postcssViewportUnits(&#123;</span><br><span class="line">            filterRule: rule &#x3D;&gt; rule.selector.indexOf(&#39;::after&#39;) &#x3D;&#x3D;&#x3D; -1 &amp;&amp; rule.selector.indexOf(&#39;::before&#39;) &#x3D;&#x3D;&#x3D; -1 &amp;&amp; rule.selector.indexOf(&#39;:after&#39;) &#x3D;&#x3D;&#x3D; -1 &amp;&amp; rule.selector.indexOf(&#39;:before&#39;) &#x3D;&#x3D;&#x3D; -1</span><br><span class="line">        &#125;),</span><br><span class="line">        &#x2F;&#x2F; postcssViewportUnits(&#123;&#125;),</span><br><span class="line">        cssnano(&#123;</span><br><span class="line">            &quot;cssnano-preset-advanced&quot;: &#123;</span><br><span class="line">                zindex: false,</span><br><span class="line">                autoprefixer: false</span><br><span class="line">            &#125;,</span><br><span class="line">        &#125;),</span><br><span class="line">        &#x2F;&#x2F; add &#x3D;&#x3D;&#x3D;&#x3D;end &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;</span><br><span class="line">        &#x2F;&#x2F; Adds PostCSS Normalize as the reset css with default options,</span><br><span class="line">        &#x2F;&#x2F; so that it honors browserslist config in package.json</span><br><span class="line">        &#x2F;&#x2F; which in turn let&#39;s users customize the target behavior as per their needs.</span><br><span class="line">        postcssNormalize(),</span><br><span class="line">    ],</span><br></pre></td></tr></table></figure>
<h1 id="react-router-dom"><a href="#react-router-dom" class="headerlink" title="react-router-dom"></a>react-router-dom</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">import &#123; BrowserRouter as Router, Route, Link ,NavLink,Redirect,Switch&#125; from &#39;react-router-dom&#39;</span><br><span class="line">&lt;Router&gt;</span><br><span class="line">    &lt;Link to&#x3D;&#39;&#x2F;&#39;&gt;xxx&lt;&#x2F;Link&gt;</span><br><span class="line">    &lt;NavLink activeClassName&#x3D;&quot;xxxx&quot; to&#x3D;&#39;&#x2F;xxx&#39;&gt;xxx&lt;&#x2F;NavLink&gt;</span><br><span class="line">    &lt;Switch&gt;</span><br><span class="line">         &lt;Redirect from&#x3D;&quot;&#x2F;xxxx&quot; to&#x3D;&quot;&#x2F;xxx&quot; &#x2F;&gt;</span><br><span class="line">         &lt;Route path&#x3D;&#39;&#x2F;xxx&#39; exact component&#x3D;&#123;xxxx&#125; &#x2F;&gt;</span><br><span class="line">    &lt;&#x2F;Switch&gt;</span><br><span class="line">&lt;&#x2F;Router&gt;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;js &#x3D;&#x3D;&gt; props.history.push(&#39;&#x2F;home&#39;)</span><br></pre></td></tr></table></figure>

<h1 id="redux"><a href="#redux" class="headerlink" title="redux"></a>redux</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>
        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2021-07-09T05:22:26.095Z" itemprop="dateUpdated">2021-07-09 13:22:26</time>
</span><br>


        
    </div>
    
    <footer>
        <a href="https://www.jscheng.top">
            <img src="/img/avatar.png" alt="jscheng">
            jscheng
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/react/" rel="tag">react</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://www.jscheng.top/2020/05/09/react-cli/&title=《react 初始化项目配置 @/、less、vw》 — jscheng&pic=https://www.jscheng.top/img/avatar.png" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://www.jscheng.top/2020/05/09/react-cli/&title=《react 初始化项目配置 @/、less、vw》 — jscheng&source=jscheng 的博客" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <!--<li>-->
        <!--<a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://www.jscheng.top/2020/05/09/react-cli/" data-title=" Facebook">-->
          <!--<i class="icon icon-facebook"></i>-->
        <!--</a>-->
      <!--</li>-->
      <!--<li>-->
        <!--<a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《react 初始化项目配置 @/、less、vw》 — jscheng&url=https://www.jscheng.top/2020/05/09/react-cli/&via=https://www.jscheng.top" data-title=" Twitter">-->
          <!--<i class="icon icon-twitter"></i>-->
        <!--</a>-->
      <!--</li>-->
      <!--<li>-->
        <!--<a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://www.jscheng.top/2020/05/09/react-cli/" data-title=" Google+">-->
          <!--<i class="icon icon-google-plus"></i>-->
        <!--</a>-->
      <!--</li>-->
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2020/05/13/electron-video/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">Electron App 在 MacOS 下 申请摄像头及麦克风权限踩坑指南</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2020/05/09/vue-vw/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">vue  vw 配置</h4>
      </a>
    </div>
  
</nav>



    











    <!-- Valine Comments -->
    <div class="comments vcomment" id="comments"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
    <!-- Valine Comments script -->
    <script>
        var GUEST_INFO = ['nick','mail','link'];
        var guest_info = 'nick,mail'.split(',').filter(function(item){
          return GUEST_INFO.indexOf(item) > -1
        });
        new Valine({
            el: '#comments',
            notify: 'false' == 'true',
            verify: 'false' == 'true',
            appId: "hgOSdOMMl0QDNQ9A5Dd0BV74-gzGzoHsz",
            appKey: "6gJhVhXHxUAUmo2qsoqpUFpi",
            avatar: "mm",
            placeholder: "请输入",
            guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
            pageSize: "10"
        })
    </script>
    <!-- Valine Comments end -->










</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


       <!-- <p>
            
            <span>博客内容遵循</span>
        </p>-->
    </div>
    <div class="bottom">
        <p><span>jscheng &copy; 2020 - 2021</span>
            <span>
                
                <a href="http://www.miitbeian.gov.cn/" target="_blank">鲁ICP备18022674号-1</a><br>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://www.jscheng.top/2020/05/09/react-cli/&title=《react 初始化项目配置 @/、less、vw》 — jscheng&pic=https://www.jscheng.top/img/avatar.png" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://www.jscheng.top/2020/05/09/react-cli/&title=《react 初始化项目配置 @/、less、vw》 — jscheng&source=jscheng 的博客" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <!--<li>-->
        <!--<a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://www.jscheng.top/2020/05/09/react-cli/" data-title=" Facebook">-->
          <!--<i class="icon icon-facebook"></i>-->
        <!--</a>-->
      <!--</li>-->
      <!--<li>-->
        <!--<a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《react 初始化项目配置 @/、less、vw》 — jscheng&url=https://www.jscheng.top/2020/05/09/react-cli/&via=https://www.jscheng.top" data-title=" Twitter">-->
          <!--<i class="icon icon-twitter"></i>-->
        <!--</a>-->
      <!--</li>-->
      <!--<li>-->
        <!--<a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://www.jscheng.top/2020/05/09/react-cli/" data-title=" Google+">-->
          <!--<i class="icon icon-google-plus"></i>-->
        <!--</a>-->
      <!--</li>-->
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=https://www.jscheng.top/2020/05/09/react-cli/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>






<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '哪去了！';
            clearTimeout(titleTime);
        } else {
            document.title = 'jscheng';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
